package com.wyy.web;

import com.wyy.pojo.Articles;
import com.wyy.pojo.LikeArticle;
import com.wyy.pojo.model.ArticleQueryCriteria;
import com.wyy.pojo.model.LabelSearch;
import com.wyy.response.CommonReturnType;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @program: gytcb
 * @author: 吴磊
 * @create: 2021-06-04 12:00
 */
@FeignClient(value = "gytcb-article", fallback = ArticleFeignActionFallBack.class)
public interface ArticleFeignAction {
    /**
     * 获取热门的文章标签
     *
     * @return
     */
    @RequestMapping(value = "/getHotArticleLabel", method = RequestMethod.POST)
    CommonReturnType getHotArticleLabel();

    /**
     * 根据内容模糊查询文章
     *
     * @param articles
     * @return
     */
    @RequestMapping(value = "/getArticleByArticleContentLikeSearch", method = RequestMethod.POST)
    CommonReturnType getArticleByArticleContentLikeSearch(@RequestBody Articles articles);


    /**
     * 根据文章Id查询文章
     *
     * @param articles
     * @return
     */
    @RequestMapping(value = "/getArticleByArticleId", method = RequestMethod.POST)
    CommonReturnType getArticleByArticleId(Articles articles);


    /**
     * 用户发布文章
     *
     * @param articles
     * @return
     */
    @RequestMapping(value = "/insertArticle", method = RequestMethod.POST)
    CommonReturnType tokenInsertArticle(Articles articles);


    /**
     * 通过文章Id删除文章及其一切相关
     *
     * @param articleId
     * @return
     */
    @RequestMapping(value = "/deleteArticleByArticleId", method = RequestMethod.POST)
    CommonReturnType tokenDeleteArticleByArticleId(String articleId);

    /**
     * 编辑帖子
     *
     * @param articles
     * @return
     */
    @RequestMapping(value = "/updateArticle", method = RequestMethod.POST)
    CommonReturnType tokenUpdateArticle(Articles articles);

    /**
     * 点赞或取消点赞
     *
     * @param likeArticle
     * @return
     */
    @RequestMapping(value = "/likeArticle", method = RequestMethod.POST)
    CommonReturnType tokenLikeOrCancelLikeArticle(LikeArticle likeArticle);

    /**
     * 通过一些条件获取帖子
     *
     * @return
     */
    @RequestMapping(value = "/getArticleBySomething", method = RequestMethod.POST)
    CommonReturnType getArticleBySomething(@RequestBody ArticleQueryCriteria articleQueryCriteria);

    /**
     * 通过文章标签模糊查询文章
     *
     * @param labelSearch
     * @return
     */
    @RequestMapping(value = "/getArticleBySearchLabel", method = RequestMethod.POST)
    CommonReturnType getArticleBySearchLabel(LabelSearch labelSearch);
}
